#include <bits/stdc++.h>
using namespace std;
void quicksort(int left,int right,vector<int>& a)
{
    if(left>=right)
        return;
    else{
        int i=0,j=right,privot = a[left];
        while(i!=j)
        {
            while(a[j]>=privot&&i<j)
                j--;
            while(a[i]<=privot&&i<j)
                i++;
            if(i<j)
                swap(a[i],a[j]);
        }
        a[left] = a[i];
        a[i] = privot;
        quicksort(left,i-1,a);
        quicksort(i+1,right,a);
    }
}
int main()
{
    vector<int> a = {1,6,8,4,3,2,7};
    int left = 0,right = a.size()-1;
//    quicksort(left,right,a);
        swap(a,a[0],a[1]);
    for(auto i:a)
        cout<<i<<" ";
}